#!/bin/bash

LANG="racket"
LANG_SHORT="rkt"
# Directory containing LORA models
LORA_DIR="/root/ljb/lr_rag/train_output/codellama_lora_${LANG}"

# Iterate through all subdirectories in the LORA directory
for lora_model in "$LORA_DIR"/*; do
    if [ -d "$lora_model" ]; then
        echo "Processing LORA model: $(basename "$lora_model")"
        
        # Execute run_inference.sh for the current LORA model
        bash run_inference.sh --name codellama/CodeLlama-7b-hf --lora-name "$lora_model" --lang ${LANG_SHORT}
        
        # Wait for the process to complete before continuing
        wait

        echo "Finished processing: $(basename "$lora_model")"
        echo "------------------------"
    fi
done

echo "All LORA models processed."
